package com.maiji.cloud.microservice;

import com.maiji.cloud.entities.login.AppUser;
import com.maiji.cloud.entities.login.UserInfo;
import com.maiji.cloud.response.BaseDataResDto;
import com.maiji.cloud.response.login.UserInfoResData;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;

@FeignClient(value = "MAIJICLOUD-APPLOGIN")
public interface UserInfoService extends MicroService<UserInfo>{

    @GetMapping("/common/checkToken/{maijiToken}")
    BaseDataResDto<AppUser> checkToken(@PathVariable(name = "maijiToken") String maijiToken, @RequestHeader(name = "isOfficial") Boolean isOfficial);

    @PostMapping("/common/deleteAppUserByRedis")
    Boolean deleteAppUserByRedis (@RequestBody String maijiToken);

    @PostMapping("/userInfo/editAppUserById")
    Boolean editAppUserById (@RequestBody AppUser appUser);

    @PostMapping("/userInfo/getAppUserByXId")
    AppUser getAppUserByXId (@RequestBody String xId);

    @Override
    @PostMapping("/userInfo/selectList")
    List<UserInfo> selectList (@RequestBody Map<String, Object> map);

    @PostMapping("/userInfo/selectListByUserIds")
    List<UserInfo> selectList (@RequestBody List<String> userIds);

    @PostMapping("/userInfo/selectListByNickName")
    List<UserInfo> selectList (@RequestBody String nickName);

    @GetMapping("/userInfo/findUserInfoByUserId")
    UserInfo findUserInfoByUserId (@RequestParam(name = "userId") String userId);

    @GetMapping("/userInfo/findUserInfoResDataByUserId")
    UserInfoResData findUserInfoResDataByUserId (@RequestParam(name = "userId") String userId);

}
